package com.example.phonestore.service.impl;

import com.example.phonestore.entity.Product;
import com.example.phonestore.mapper.ProductMapper;
import com.example.phonestore.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ProductServiceImpl implements ProductService {
    @Autowired
    private ProductMapper productMapper;
    @Override
    public List<Product> showHotProduct() {
        List<Product> list=productMapper.showHotProduct();
        return list;
    }

    @Override
    public Product getProductOne(Integer id) {
        Product product=productMapper.findByProductId(id);
        return product;
    }
}
